﻿<div class="jumbotron">
    <h1>ASP.NET</h1>
    
</div>
<textarea id="editor" name="editor"></textarea>
<input id="run" type="button" value="run"/>
<script src="~/Scripts/codemirror.js"></script>
<script src="~/Scripts/python.js"></script>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/addon/edit/matchbrackets.js"></script>
<link rel="stylesheet" href="~/Content/codemirror.css">
<link rel="stylesheet" href="~/Content/docs.css">
<script type="text/javascript">
    var myTextarea = document.getElementById('editor');
    var CodeMirrorEditor = CodeMirror.fromTextArea(myTextarea, {
        mode: {
            name: "python",
            version: 3,
            singleLineStringErrors: false
        },
        lineNumbers: true,
        indentUnit: 4,
        matchBrackets: true
    });
    $("#run").click(function () {
        $.post("http://localhost:13756/Help/Api/POST-api-UsingPython_pythonContent", { pythonContent: $("#editor").val() }, function (data, status) {
            alert("Data: " + data + "nStatus: " + status);
        });
    })
</script>